.class final Lcom/ninesky/browser/co;
.super Landroid/content/BroadcastReceiver;


# instance fields
.field private synthetic a:Lcom/ninesky/browser/DownloadActivity;


# direct methods
.method constructor <init>(Lcom/ninesky/browser/DownloadActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 8

    const-wide/16 v6, -0x1

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    const-string v2, "android.intent.action.DOWNLOAD_COMPLETED"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->e(Lcom/ninesky/browser/DownloadActivity;)V

    iget-object v1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->f(Lcom/ninesky/browser/DownloadActivity;)V

    iget-object v1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->j(Lcom/ninesky/browser/DownloadActivity;)Landroid/app/AlertDialog;

    move-result-object v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->j(Lcom/ninesky/browser/DownloadActivity;)Landroid/app/AlertDialog;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/AlertDialog;->isShowing()Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->j(Lcom/ninesky/browser/DownloadActivity;)Landroid/app/AlertDialog;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/AlertDialog;->dismiss()V

    :cond_0
    invoke-virtual {p2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v1

    if-eqz v1, :cond_1

    const-string v2, "_data"

    invoke-virtual {v1, v2}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_1

    :try_start_0
    move-object v0, v2

    check-cast v0, Landroid/net/Uri;

    move-object v1, v0

    invoke-static {v1}, Landroid/content/ContentUris;->parseId(Landroid/net/Uri;)J
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-wide v1

    :goto_0
    cmp-long v3, v1, v6

    if-eqz v3, :cond_1

    iget-object v3, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v3}, Lcom/ninesky/browser/DownloadActivity;->d(Lcom/ninesky/browser/DownloadActivity;)J

    move-result-wide v3

    cmp-long v1, v1, v3

    if-nez v1, :cond_1

    const/4 v1, 0x2

    new-array v1, v1, [Lcom/ninesky/widget/g;

    const/4 v2, 0x0

    iget-object v3, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v3}, Lcom/ninesky/browser/DownloadActivity;->h(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;

    move-result-object v3

    aput-object v3, v1, v2

    const/4 v2, 0x1

    iget-object v3, p0, Lcom/ninesky/browser/co;->a:Lcom/ninesky/browser/DownloadActivity;

    invoke-static {v3}, Lcom/ninesky/browser/DownloadActivity;->i(Lcom/ninesky/browser/DownloadActivity;)Lcom/ninesky/widget/l;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v1}, Lcom/ninesky/browser/DownloadActivity;->a([Lcom/ninesky/widget/g;)V

    :cond_1
    return-void

    :catch_0
    move-exception v1

    const-string v3, "NSBrowser.DownloadActivity"

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "Data:"

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v4, "Error:"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v1}, Ljava/lang/NumberFormatException;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    move-wide v1, v6

    goto :goto_0
.end method
